package com.caishi.lkx.common.message;

import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author by keray
 * date:2019/12/4 3:19 PM
 */
@Document(collection = "langrun_push_message")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Getter
@Setter
public class MessageModel implements Serializable {

    @Id
    private String id;

    /**
     * 创建时间
     */
    private long createdTime;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 用户id
     */
    @Indexed
    private String userId;

    /**
     * 是否已读
     */
    @Indexed
    private Boolean haveRead;

    /**
     * 阅读时间
     */
    private LocalDateTime readTime;

    /**
     * 消息标签
     */
    private String tag;

    /**
     * 消息简介
     */
    private String introduction;
    /**
     * 消息标题
     */
    private String title;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 消息封面
     */
    private String cover;
    /**
     * 跳转url
     */
    private String jumpUrl;

    /**
     * 消息关联类型
     */
    private MessageType entityType;

    /**
     * 消息关联id
     */
    private String entityId;

    private String type;
}
